package ee.serge.util;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public abstract class Content extends VerticalPanel {

   private SimplePanel headerPanel;
   
   public Content() {
      setStyleName("content");
      RootPanel.get("headline").setVisible(false);
      Loader.hide();
   }
   
   public static void show() {
      throw new RuntimeException("This mehtod needs to be overridden.");
   }
   
   public static String getName() {
      throw new RuntimeException("This mehtod needs to be overridden.");
   }
   
   public static URLData getURLData() {
      throw new RuntimeException("This mehtod needs to be overridden.");
   }
   
   public void setHeader(String header) {
   	Window.setTitle(header);
   	RootPanel.get("headline").clear();
   	RootPanel.get("headline").add(new Header1(header));
      RootPanel.get("headline").setVisible(true);
   }
   
   public void setHeader(String header, String smallText) {
   	Window.setTitle(header);
   	RootPanel.get("headline").clear();
   	RootPanel.get("headline").add(new Header1(header + " ", smallText));
   	RootPanel.get("headline").setVisible(true);
   }
   
}
